import re
lines="Cats are smarter than dogs"
matchObj = re.search( r'(.*) are (.*?) .*', lines, re.M|re.I)
if matchObj:
    print "matchObj.group() : ", matchObj.group()
    print "matchObj.group(1) : ", matchObj.group(1)
    print "matchObj.group(2) : ", matchObj.group(2)
else:
	print "No match!!"

line = "Cats are smarter than dogs";

matchObj1 = re.match(r'dogs', line, re.M | re.I)
if matchObj1:
    print "match --> matchObj.group() : ", matchObj1.group()
else:
    print "No match!!"

matchObj1 = re.search(r'dogs', line, re.M | re.I)
if matchObj1:
    print "search --> matchObj.group() : ", matchObj1.group()
else:
    print "No match!!"